package com.szr.leex.controller.debtor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.szr.leex.controller.BaseController;
import com.szr.leex.po.debtor.DebtorInfo;
import com.szr.leex.service.debtor.DebtorInfoService;

/**
 * 场景方信息controller
 * Created by WangChen on 2018/8/25 11:38.
 */
@RestController
@RequestMapping("/debtorInfo")
public class DebtorInfoController extends BaseController {

    @Autowired
    private DebtorInfoService debtorService;

    @RequestMapping("/list")
    public List list(){
        return debtorService.list();
    }

    @RequestMapping("/add")
    public DebtorInfo add(@RequestBody DebtorInfo debtorInfo){
        return debtorService.add(debtorInfo);
    }

    @RequestMapping("/orgCode")
    public DebtorInfo findByOrgCode(String orgCode){
        return debtorService.findByOrgCode(orgCode);
    }

    @RequestMapping("/sssss")
    public Page sssss(String orgCode, Pageable pageable){
        return debtorService.ssss(orgCode, pageable);
    }
}
